package com.blb.mybatis.controller;

import com.blb.mybatis.entity.Goods;
import com.blb.mybatis.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class GoodsController {

    @Autowired
    private GoodsService goodsService;

    @RequestMapping("/getALL")
    public String selectAll(Model model){
        List<Goods> goods = goodsService.selectAll();
        model.addAttribute("goods",goods);
        return "goodsList";
    }

}
